package com.jlnk.servicedemo.entity;

public class MediaItem {
    private String title;
    private String artist;
    private String path; // 歌曲文件路径
    private int resId; // 使用资源 ID

    // 构造函数1：初始化路径
    public MediaItem(String title, String artist, String path) {
        this.title = title;
        this.artist = artist;
        this.path = path;
        this.resId = -1; // 没有资源ID时，可以设置为-1或其他无效值
    }

    // 构造函数2：初始化资源ID
    public MediaItem(String title, String artist, int resId) {
        this.title = title;
        this.artist = artist;
        this.path = null; // 没有路径时，可以设置为null
        this.resId = resId;
    }
    public boolean hasResId() {
        return resId != -1;
    }

    public boolean hasPath() {
        return path != null;
    }
    // Getter和Setter方法
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getArtist() {
        return artist;
    }

    public void setArtist(String artist) {
        this.artist = artist;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public int getResId() {
        return resId;
    }

    public void setResId(int resId) {
        this.resId = resId;
    }
}